Wi-Fi networks are now more and more popular among urban residents. Some public places or private places have provided Wi-Fi networks to the public free of charge. Public Wi-Fi brings convenience to people’s lives and transportation. On the other hand, people’s behavior data recorded by Wi-Fi is an important data source. It can provide data for better urban planning. Of course, there is also a certain commercial value. The construction of public Wi-Fi in the city is an important step in building a smart city. Reasonable site selection can improve the efficiency of resource utilization.
The subway is a good way to travel on weekdays, it won’t be affected by traffic jams compared to other modes of transportation.In the spare time, cycling is a great way to relax and exercise.This notebook analyzes the current Wi-Fi station and traffic data(Subway and Bicycle) in New York City, finds potential deficiencies, and proposes corresponding strategies.
Data: 1) NYC Free Public Wi-Fi 2) NYC Subway Routes 3) NYC Subway Stations 4) NYC Bicycle Routes 5) NYC Bicycle Parking Shelters
getwd()
[1] "/Users/afen/Documents/GitHub/WIFI_hotspot_analysis_based_NYC"
names(wifi_data)
[1] "BORO" "the_geom" "TYPE" "OBJECTID" "PROVIDER" "NAME" "LAT"
[8] "LOCATION" "LON" "X" "Y" "LOCATION_T" "REMARKS" "CITY"
[15] "SSID" "SOURCEID" "ACTIVATED" "BOROCODE" "BORONAME" "NTACODE" "NTANAME"
[22] "COUNDIST" "POSTCODE" "BOROCD" "CT2010" "BOROCT2010" "BIN" "BBL"
[29] "DOITT_ID"
summary(wifi_data)
the_geom TYPE PROVIDER
POINT (-73.76955899961533 40.6871909999958) : 14 Free :2762 LinkNYC - Citybridge:1867
POINT (-73.93935699958523 40.812680999589254): 8 Limited Free: 581 SPECTRUM : 343
POINT (-73.99797999992514 40.710249999883835): 8 Partner Site: 2 Transit Wireless : 276
POINT (-73.9141379998959 40.81154399995916) : 7 ALTICEUSA : 237
POINT (-73.94490899985944 40.805012999655474): 7 Harlem : 128
POINT (-73.98834699960128 40.69363599965358) : 7 Downtown Brooklyn : 100
(Other) :3294 (Other) : 394
LAT LOCATION LON X Y
Min. :40.51 Park Perimeter : 42 Min. :-74.24 Min. : 916371 Min. :125007
1st Qu.:40.70 Along Boardwalk and Beach : 15 1st Qu.:-73.99 1st Qu.: 988242 1st Qu.:192750
Median :40.75 300 Jay Street : 11 Median :-73.96 Median : 994923 Median :211164
Mean :40.74 333 Adams St. : 8 Mean :-73.95 Mean : 998079 Mean :209724
3rd Qu.:40.79 110 Livingston St. : 7 3rd Qu.:-73.93 3rd Qu.:1004358 3rd Qu.:228306
Max. :40.90 North area off Richmond Terr: 6 Max. :-73.71 Max. :1063266 Max. :268544
(Other) :3256
BORONAME
Bronx : 316
Brooklyn : 700
Manhattan :1698
Queens : 531
Staten Island: 100
# Data visualization
library(ggplot2)
wifi_pro + geom_bar(aes(fill=TYPE)) + scale_fill_brewer(direction = -1,palette = "Green") + theme(axis.text.x = element_text(colour="grey20",size = 5,angle=45,hjust=.5,vjust=.5,face="plain"))
Unknown palette Green
wifi_boro + geom_bar(aes(fill=TYPE)) + scale_fill_brewer(palette = "Green",direction = -1)
Unknown palette Green
Choropleth and Heat map powered by carto[https://carto.com/]
# use cartodb to do analysis from spatial database
library(RCurl)
library(bitops)
library(RJSONIO)
library(devtools)
library(CartoDB)
cartodb("zhoumaneo")
Without an API key you are limited to read-only
cartodb.test()
http://zhoumaneo.carto.com/api/v2/sql?api_key=&
cartodb("zhoumaneo", api.key="fb070799acad21d626b5ade94caa3542b7decd88")
library(rgdal)
bicycle_routes <- cartodb.collection(sql="SELECT * FROM bicycle_routes",method="GeoJSON")
bicycle_routes.SP <- readOGR(bicycle_routes,layer = 'OGRGeoJSON',verbose =FALSE)
Free_wifi_hotspot <- cartodb.collection(sql = "SELECT * FROM nyc_wi_fi_hotspot_locations WHERE type = 'Free'",method = "GeoJSON")
Free_wifi_hotspot.SP <- readOGR(Free_wifi_hotspot,layer = 'OGRGeoJSON',verbose = FALSE)
bicycle_parking_shelters <- cartodb.collection(sql="SELECT * FROM bicycle_parking_shelters",method = "GeoJSON")
bicycle_parking_shelters.SP <- readOGR(bicycle_parking_shelters,layer = 'OGRGeoJSON',verbose = FALSE)
This plot is to show the location relationship between free wifi hotspot and bicycle routes
plot(bicycle_routes.SP)
plot(Free_wifi_hotspot.SP,col = "red",add = TRUE)
plot(bicycle_parking_shelters.SP,col = "green",add = TRUE, pch = 20)
Limited_free_wifi_hotspot <- cartodb.collection(sql = "SELECT * FROM nyc_wi_fi_hotspot_locations WHERE type = 'Limited Free'",method = "GeoJSON")
Limited_free_wifi_hotspot.SP <- readOGR(Limited_free_wifi_hotspot,layer = 'OGRGeoJSON',verbose = FALSE)
This plot is to show the location relationship between limited free wifi hotspot and bicycle routes
plot(bicycle_routes.SP)
plot(Limited_free_wifi_hotspot.SP,col = "red",add = TRUE)
plot(bicycle_parking_shelters.SP, col = "green",add = TRUE, pch = 20)
subway_routes <- cartodb.collection(sql = "SELECT * FROM subway",method = "GeoJSON")
subway_routes.SP <- readOGR(subway_routes,layer = 'OGRGeoJSON',verbose = FALSE)
subway_stations <- cartodb.collection(sql = "SELECT * FROM subway_stations",method = "GeoJSON")
subway_stations.SP <- readOGR(subway_stations,layer = 'OGRGeoJSON',verbose = FALSE)
This plot is to show the location relationship between wifi hotspot and subway routes
plot(subway_routes.SP)
plot(subway_stations.SP,add = TRUE)
plot(Free_wifi_hotspot.SP,col = "green",add = TRUE)
plot(Limited_free_wifi_hotspot.SP,col = "dark green",add = TRUE)
The wifi signal is spread out by the wifi station. The signal strength decreases with distance. Generally, the Wi-Fi signal has a radiation distance of less than 100m. This notebook uses 100m as range to do buffer as the zones of signal covered. And then do some spatial intersect analysis to see the signal coverage of various subway lines and bicycle routes. Finally, I also use buffer and intersection to see the utilizations of wifi hotspot.
#Return buffers
wifi_buffers <- cartodb.collection(sql="SELECT cartodb_id, ST_Buffer(the_geom::geography,100) as the_geom FROM nyc_wi_fi_hotspot_locations",method="GeoJSON")
# Plot the results
wifi_buffers.SP <- readOGR(wifi_buffers,layer = 'OGRGeoJSON',verbose =FALSE)
#Plot first 100 tree buffers
plot(wifi_buffers.SP[1:100,])
Wifi hotspot locations buffer by carto
The signal coverage of various subway lines.
The signal coverage of various bicycle routes.
subway_routes_buffers <- cartodb.collection(sql="SELECT cartodb_id, ST_Buffer(the_geom::geography,100) as the_geom FROM subway",method="GeoJSON")
# Plot the results
subway_routes_buffers.SP <- readOGR(subway_routes_buffers,layer = 'OGRGeoJSON',verbose =FALSE)
#Plot first 100 tree buffers
plot(subway_routes_buffers.SP)
Find the wifi hotspots that do not intersect with the buffer of subway routes
wifi_hotspot_without_subway_routes <- cartodb.collection(sql = "SELECT a.* FROM nyc_wi_fi_hotspot_locations AS a,subway AS b WHERE NOT ST_Intersects(a.the_geom,ST_Buffer(b.the_geom::geography,100))",method = "GeoJSON")
Error in cartodb.collection(sql = "SELECT a.* FROM nyc_wi_fi_hotspot_locations AS a,subway AS b WHERE NOT ST_Intersects(a.the_geom,ST_Buffer(b.the_geom::geography,100))", :
could not find function "cartodb.collection"
#Plot first 100 tree buffers
plot(wifi_hotspot_without_subway_routes.SP,col = "red")
plot(subway_routes.SP,add=TRUE)
Red points show some wifi hotspots don’t locate within 100m from the subway routes.
wifi_hotspot_without_bicycle_routes <- cartodb.collection(sql = "SELECT a.* FROM nyc_wi_fi_hotspot_locations AS a,bicycle_routes AS b WHERE NOT ST_Intersects(a.the_geom,ST_Buffer(b.the_geom::geography,100))",method = "GeoJSON")
wifi_hotspot_without_bicycle_routes.SP <- readOGR(wifi_hotspot_without_bicycle_routes,layer = 'OGRGeoJSON',verbose =FALSE)
plot(wifi_hotspot_without_bicycle_routes.SP,col = "red")
plot(bicycle_routes.SP,add=TRUE)
Red points show some wifi hotspots don’t locate within 100m from the bicycle routes.
wifi_hotspot_without_subway_bicycle_routes <- cartodb.collection(sql = "SELECT a.* FROM nyc_wi_fi_hotspot_locations AS a,bicycle_routes AS b,subway AS c WHERE NOT ST_Intersects(a.the_geom,ST_Buffer(b.the_geom::geography,100)) AND NOT ST_Intersects(a.the_geom,ST_Buffer(c.the_geom::geography,100))",method = "GeoJSON")
wifi_hotspot_without_subway_bicycle_routes.SP <- readOGR(wifi_hotspot_without_subway_bicycle_routes,layer = 'OGRGeoJSON',verbose =FALSE)
Only one point is neither in the buffer of the subway line nor in the buffer of the bicycle routes
wifi_hotspot_without_subway_routes_table <- cartodb.collection(sql = "SELECT a.* FROM nyc_wi_fi_hotspot_locations AS a,subway AS b WHERE NOT ST_Intersects(a.the_geom,ST_Buffer(b.the_geom::geography,100))")
The number of free wifi hotspots is different in different boroughs in New York City. There is the largest number of wifi hotspots in Manhattan.
From the signal coverage maps above, most subway lines are covered by strong wireless network signals. On the other hand, most bicycle routes don’t covered by wifi signals. When there are some emergencies along these routes, people may not get Wi-Fi support.
c.Most Wi-Fi stations are highly utilized.They provide wifi for passengers on the subway or cyclists.
Build wifi database to record the behavior data of people from wifi stations.These data can in turn help Wi-Fi station site selection. Except this, this dataset can help analyze other urban issues.
It can be a good way that recruiting merchant financing by sharing wifi data to improve the construction of basic wifi hotspot.
Promote healthy lifestyles to organize cycling activities to attract investment and improve infrastructure.
Seufert, Griepentrog, Burger, & Hobfeld. (2016). A Simple WiFi Hotspot Model for Cities. Communications Letters, IEEE, 20(2), 384-387.
Gowex. (2013). Gowex to merge public, private WiFi to create smart city hotspot networks. Total Telecom Magazine, Total Telecom Magazine, Nov 5, 2013.
Data Visualization with ggplot2 Cheat Sheet [https://www.rstudio.com/wp-content/uploads/2015/03/ggplot2-cheatsheet.pdf]
CartoDB[https://github.com/CartoDB/cartodb]